home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW Related / MPW Script Tips 1.1.1 / Sample Scripts / UserStartup•mine < prev    next >
Encoding:
Text File  |  1991-08-16  |  8.3 KB  |  250 lines  |  [TEXT/MPS ]

  1. #-------------------------------------------------------------------------------
  2. #    UserStartup•mine
  3. #    MPW Shell Script
  4. #    Written by Gina Cherry, Mark Baumwell, and Godfrey DiGiorgi • August 16, 1991
  5. #    Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  6. #    
  7. #    Usage:    
  8. #            UserStartup•mine is executed automatically from the Startup script when MPW is launched.
  9. #    
  10. #    Function:
  11. #            UserStartup•mine creates aliases, defines shell variables, and adds frequently used 
  12. #            commands to the menus.  This script is meant to be an example of some of the commands
  13. #            you may want to include in your UserStartup file.  It should be modified to conform to
  14. #            your file setup and preferences.
  15. #-------------------------------------------------------------------------------
  16.         
  17.  
  18. #    Position cursor at end of worksheet.
  19.     Find ∞ "{Worksheet}"
  20.  
  21.  
  22. #-------------------------------------------------------------------------------
  23. #    Define aliases
  24. #-------------------------------------------------------------------------------
  25. # Aliases for shell commands.
  26.     Alias    Cat         Catenate
  27.     Alias     Cd         Directory
  28.     Alias     Cp         Duplicate
  29.     Alias     Grep     Search
  30.     Alias     Ls         Files
  31.     Alias     Mkdir     Newfolder
  32.     Alias     Mv         Move
  33.     Alias     Pr         Print
  34.     Alias     Pwd        Directory
  35.     Alias     Rm         Delete
  36.  
  37. #    Aliases for applications.
  38. #    Change these aliases to conform to your system.
  39.     Alias     Res             '"HD:ResEdit"'
  40.     Alias     MSWord    '"HD:Microsoft Word"'
  41.     Alias    ALink        '"HD:AppleLink"'
  42.  
  43.  
  44. #-------------------------------------------------------------------------------
  45. #    Initialize shell variables.
  46. #-------------------------------------------------------------------------------
  47. #    Define a new shell variable Word.    
  48.     Set Word "[{WordSet}]+"
  49.     #    Make Word variable available to other scripts.
  50.         Export Word
  51.  
  52. #    Define a new shell variable Scripts.    
  53.     Set Scripts "{MPW}Scripts:"
  54.     #    Make Scripts variable available to other scripts.
  55.         Export Scripts
  56.         
  57. #    Define a new shell variable Source.
  58. #    Change this definition to conform to your system.
  59.     Set Source "{MPW}Source Code"
  60.     #    Make Source variable available to other scripts.
  61.         Export Source
  62.  
  63. #    Define shell variable openList to be used by the script MyOpen
  64. #    Change this definition to conform to your system.
  65.     Set openList "':' '{Scripts}' '{Source}' '{MPW}'"
  66.     #    Make openList variable available to other scripts.
  67.         Export openList
  68.  
  69. #    Set the Commands shell variable, which tells the shell where to look for commands to execute.
  70. #    Change this definition to conform to your system.
  71.     Set Commands ":,{MPW}Tools:,{MPW}Scripts:,{MPW}MyTools:,{MPW}MyScripts:"
  72.     #    Make the Commands variable available to other scripts.
  73.         Export Commands
  74.  
  75. #    Set the DirectoryPath shell variable, which tells the shell where to look for directories when 
  76. #    changing directories. This allows the user to type shorter pathnames when changing to commonly 
  77. #    used directories.
  78. #    Change this definition to conform to your system.
  79.     Set DirectoryPath ":,{MPW},{Scripts},{MPW}MyScripts:,{Source}"
  80.     #    Make DirectoryPath variable available to other scripts.
  81.         Export DirectoryPath
  82.  
  83. #    Change the following definitions to suit your preferences:
  84.  
  85.     #    Set the default font for new windows.    
  86.         Set Font Geneva
  87.         
  88.     #    Set the default font size for new windows.    
  89.         Set FontSize 10
  90.         
  91.     #    Set the default window size for new windows.
  92.         Set NewWindowRect 0,0,400,500
  93.         
  94.     #    Set default window size for zooming.  In this example, ZoomWindowRect is set to a reasonable size
  95.     #    for a 2 page monitor, so that windows won't zoom to the full size of the monitor when the user clicks
  96.     #    on the zoom box.
  97.         Set ZoomWindowRect 0,550,825,1100
  98.     
  99.     # Set options used by print menu.  Print page headers at top of each page.  Set form feed to œ 
  100.     #    (option q). Print line numbers to left of printed text.  Write progress information to diagnostic 
  101.     #    output.  
  102.         Set PrintOptions '-h -ff œ -n -p'
  103.         
  104.     
  105. #-------------------------------------------------------------------------------
  106. #    Mount Current Projects
  107. #-------------------------------------------------------------------------------
  108. #    Change this command to mount projects on which you are currently working.
  109.     MountProject MyProject
  110.  
  111.  
  112. #-------------------------------------------------------------------------------
  113. #    Customize menus
  114. #-------------------------------------------------------------------------------
  115. #    Modify the Edit menu.
  116.     #    Add disabled separator bar.
  117.         AddMenu Edit '(-' ''
  118.     #    Add commands and their keyboard equivalents.
  119.         AddMenu Edit 'Show Invisibles/2'  ∂
  120.             'ShowNPChar'
  121.         AddMenu Edit 'Comment/3' ∂
  122.             'Comment "{Active}"'
  123.         AddMenu Edit 'LtoU/4' ∂
  124.             'LtoU "{Active}"'
  125.         AddMenu Edit 'UtoL/5' ∂
  126.             'UtoL "{Active}"'
  127.     
  128. # Modify the Find menu.
  129.     #    Add Commando dialog for ReplaceAll
  130.         AddMenu Find 'Replace All/P'     ∂
  131.             'ReplaceAll…'                                
  132.     #    Add disabled separator bar.
  133.         AddMenu Find (- ''
  134.     #    Add GoTo command to the Find menu.
  135.         AddMenu Find 'GoTo/7' ∂
  136.             'GoTo "{Active}"'
  137.     #    Add Commando dialogs for WhereIs and Search to the Find menu.
  138.         AddMenu Find 'WhereIs/8' ∂
  139.             'WhereIs…'
  140.         AddMenu Find 'Search/9' ∂
  141.             'SearchAll…'
  142.         AddMenu Find 'Search & Set/¥' ∂
  143.             'SS'
  144.  
  145. #    Create the Directory menu
  146. #    Change this section to add other frequently used directories to the parameter list.
  147.     DirectoryMenu "{Scripts}"  "{Source}" `Directory`
  148.  
  149. #    Modify the Projector menu
  150.     #    Add disabled separator bar.
  151.         AddMenu Project '(-' ''
  152.     #    Add Commando dialog for NameRevisions command.
  153.         AddMenu Project 'Name Revisions' ∂
  154.             'NameRevisions…'
  155.     #    Add Commando for RevertToRevision command
  156.         AddMenu Project 'Revert To Old Revision' ∂
  157.             'RevertToRevision'
  158.     
  159.     
  160. #    Create the Tools menu        
  161.     #    Add disabled separator bar and header.
  162.         AddMenu Tools '(-' ''
  163.         AddMenu Tools '(Application Tools  ' ''
  164.         AddMenu Tools '(-' ''
  165.     #    Add applications to Tools menu
  166.     #    Change this section to add other frequently used applications.
  167.         AddMenu Tools 'Microsoft Word' ∂
  168.             'MSWord'
  169.         AddMenu Tools 'AppleLink' ∂
  170.             'ALink'
  171.         AddMenu Tools 'ResEdit' ∂
  172.             'Res'
  173.             
  174.     #    Add disabled separator bar and header.
  175.         AddMenu Tools '(-' ''
  176.         AddMenu Tools '(Other Tools  ' ''
  177.         AddMenu Tools '(-' ''
  178.     #    Add other tools to Tools menu. 
  179.         AddMenu Tools 'Prototype C Functions'         ∂
  180.             'ProtoGen…'
  181.         AddMenu Tools 'Mark C Functions'             ∂
  182.             'MarkIt…'
  183.         AddMenu Tools A2Hex                                 ∂
  184.             'A2Hex "{Active}" ∑∑ "{Worksheet}"'
  185.         AddMenu Tools 'Conversion Table'                 ∂
  186.             'Open -r "{MPW}Scripts:Dec-Oct-Hex-BinTable"'
  187.         AddMenu Tools 'Indicate 80 Columns'         ∂
  188.             'Indicate80Columns'    
  189.         
  190.         
  191. #    Create the Commands menu    
  192.     #    Add disabled separator bar and header.
  193.         AddMenu Commands '(-' ''
  194.         AddMenu Commands '(ACTIVE' ''
  195.         AddMenu Commands '(-' ''
  196.     #    Add command to echo the name of the active window to the worksheet.    
  197.         AddMenu Commands 'Echo Active' ∂
  198.             'Echo "{Active}" >> {Worksheet}' 
  199.     #    Add command to position cursor at the top of the active window.    
  200.         AddMenu Commands 'TOP of Active file' ∂
  201.             'Find • "{Active}"'
  202.     #    Add command to position cursor at the bottom of the active window.    
  203.         AddMenu Commands 'BOTTOM of Active file' ∂
  204.             'Find ∞ "{Active}"'
  205.         
  206.     #    Add disabled separator bar and header.    
  207.         AddMenu Commands '(-' ''
  208.         AddMenu Commands '(TARGET' ''
  209.         AddMenu Commands '(-' ''
  210.     #    Add command to echo the name of the target window to the worksheet.    
  211.         AddMenu Commands 'Echo Target' ∂
  212.             'Echo "{Target}" >> "{Worksheet}"'
  213.     #    Add command to position cursor at the top of the target window.
  214.         AddMenu Commands 'TOP of Target file' ∂
  215.             'Find • "{Target}"'
  216.     #    Add command to position cursor at the bottom of the target window.
  217.         AddMenu Commands 'BOTTOM of Target file' ∂
  218.             'Find ∞ "{Target}"'
  219.     
  220.     #    Add disabled separator bar and header.    
  221.         AddMenu Commands '(-' '' 
  222.         AddMenu Commands '(Window Management' '' 
  223.         AddMenu Commands '(-' ''
  224.     #    Add command to save all windows.
  225.         AddMenu Commands 'Save All/E' ∂
  226.             "Save -a"
  227.     #    Add command to close all windows.
  228.         AddMenu Commands 'Close All/K' ∂
  229.             "Close -a"
  230.     #    Add disabled separator bar.
  231.         AddMenu Commands '(-' ''
  232.         AddMenu Commands 'RotateWindows/®' ∂
  233.             'RotateWindows'
  234.         AddMenu Commands 'Cleanup Windows/©' ∂
  235.             "CleanWindows"
  236.         AddMenu Commands 'Side-By-Side/ß' ∂
  237.             "VTileWindows ≥ Dev:Null"
  238.         AddMenu Commands 'Small Window/∑' ∂
  239.             "SmallWindow"
  240.         
  241.         AddMenu Commands '(-' ''
  242.         AddMenu Commands '(Other Commands' ''
  243.         AddMenu Commands '(-' ''
  244.         Execute AddDeleteMenu
  245.         AddMenu Commands 'Search and Open/Ω' 'MyOpen'
  246.  
  247. #    Set the current directory to Source.        
  248. #    Change this command to set directory to the directory of your preference.
  249.     SetDirectory "{Source}"
  250.